home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Graphics / Graphic Utilities / Vision Lab / invertclut.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-16  |  791 b   |  28 lines  |  [TEXT/KAHL]

  1. #include <:Mac #includes:asm.h>
  2. #include <:Mac #includes:Color.h>
  3.  
  4. #include "Commando:Programming:LightspeedC™:Vision Lab:shared.h"
  5.  
  6. int main(AppDataPtr)
  7. SharePtr AppDataPtr;
  8. {
  9.     int i, CL;
  10.     CTabPtr clutPtr;
  11.     unsigned long rgbValue;
  12.     clutPtr = *(AppDataPtr->pixMapPtr->pmTable);
  13.     CL = clutPtr->ctSize+1;
  14.     for (i = 0; i<CL; i++) {
  15.         rgbValue = clutPtr->ctTable[i].rgb.red;
  16.         rgbValue = ((unsigned long) 0xFFFF) - rgbValue;
  17.         clutPtr->ctTable[i].rgb.red = rgbValue;
  18.         rgbValue = clutPtr->ctTable[i].rgb.green;
  19.         rgbValue = ((unsigned long) 0xFFFF) - rgbValue;
  20.         clutPtr->ctTable[i].rgb.green = rgbValue;
  21.         rgbValue = clutPtr->ctTable[i].rgb.blue;
  22.         rgbValue = ((unsigned long) 0xFFFF) - rgbValue;
  23.         clutPtr->ctTable[i].rgb.blue = rgbValue;
  24.     }
  25.     AppDataPtr->ClutChanged = TRUE;
  26.     return(noErr);
  27. }
  28.